#include <stdio.h>
#include "circle.h"
#include "shape.h"
#include "panel.h"

void drawCircle(Shape *self, void *panel) {
    Circle *circle = (Circle *)self;
    Panel *p = (Panel *)panel;
    int centerX = circle->base.x;
    int centerY = circle->base.y;
    int radius = circle->radius;
    char ch = circle->base.ch;

    for (int i = -radius; i <= radius; i++) {
        for (int j = -radius; j <= radius; j++) {
            if (abs(i * i + j * j - radius * radius) <= radius) {
                drawPixel(p, centerX + j, centerY + i, ch);
            }
        }
    }
}

